package com.navi.loaddata.core.oracleEntity.spc;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by ghost on 2018/6/13.
 */
public class ControlDataPK implements Serializable{

    private String chartid;
    private String controldataseq;
    private Timestamp eventtimePre;

    @Column(name = "chartid")
    @Id
    public String getChartid() {
        return chartid;
    }

    public void setChartid(String chartid) {
        this.chartid = chartid;
    }

    @Column(name = "controldataseq")
    @Id
    public String getControldataseq() {
        return controldataseq;
    }

    public void setControldataseq(String controldataseq) {
        this.controldataseq = controldataseq;
    }

    @Column(name = "eventtime_pre")
    @Id
    public Timestamp getEventtimePre() {
        return eventtimePre;
    }

    public void setEventtimePre(Timestamp eventtimePre) {
        this.eventtimePre = eventtimePre;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ControlDataPK that = (ControlDataPK) o;

        if (chartid != null ? !chartid.equals(that.chartid) : that.chartid != null) return false;
        if (controldataseq != null ? !controldataseq.equals(that.controldataseq) : that.controldataseq != null)
            return false;
        if (eventtimePre != null ? !eventtimePre.equals(that.eventtimePre) : that.eventtimePre != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = chartid != null ? chartid.hashCode() : 0;
        result = 31 * result + (controldataseq != null ? controldataseq.hashCode() : 0);
        result = 31 * result + (eventtimePre != null ? eventtimePre.hashCode() : 0);
        return result;
    }
}
